<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">	
<title>获取识别码</title>
<link href="./static/css/bootstrap.min.css" rel="stylesheet" />
<style type="text/css">
.container {
	max-width: 540px;
	text-align: center;
}
#btn {
	margin-top: 50px;
}

#code-span h2 {
	margin-top: 50px;
}

</style>
</head>
<body>
	<div class="container">
		<button id="btn" type="button" class="btn btn-success btn-lg" onclick="getCode()">点击获取识别码</button>
		<span id="code-span"><h2></h2></span>
	</div>
	
</body>
<script type="text/javascript" src="./static/js/jquery-1.11.0.min.js"></script>
<script type="text/javascript" src="./static/js/bootstrap.min.js"></script>
<script type="text/javascript" src="./static/js/axios.min.js"></script>
<script type="text/javascript">

	function getCode() {
		$("#btn").attr('disabled', true)

		axios.get('/lottery/GetCode.php')
			.then(function(respone) {
				let code = respone.data.code
				console.log(code)
				$("#code-span h2").text(code)
			})
	}

</script>
</html>